import React from 'react';
import {

} from 'react-native';

import {ObjUtils} from '../../utils/Utils';
import HeartConstants from '../../common/HeartConstants';
import ToastUtils from '../../common/ToastUtils';
import CommonDataEditListPage from '../common/CommonDataEditListPage';
import HeartLoveRquestUpdateSelfDataAction from '../../actions/heart/HeartLoveRquestUpdateSelfDataAction';

export default class HeartLoveCommonDataEditPage extends CommonDataEditListPage {
  constructor(props) {
    super(props);

    // this._isShowSubmit = this.props.pageData.routeData.isShowSubmit;
    // this._submitText = this.props.pageData.routeData.submitText;
    this.state.statusText = "";
    this.state.viewStatus = 0;
    // this._isShowSubmit = true;
    this._submitText = "保 存";
  }

  componentWillUpdate(nextProps, nextState) {
    this._checkUnAutorization(nextProps, nextState);
    if(this.state.statusText != nextState.statusText) {
      ToastUtils.show(nextState.statusText);
    }
  }

  _initPageButtonValues() {
    this._pageButtonValues = this.props.pageData.routeData.loveData;
    // this._pageButtonValues = ObjUtils.copy(this.props.pageData.routeData.loveData);
  }

  _getPageDatas() {
    return this.props.pageData.routeData.pageButtonDatas;
  }

  _onPressSubmit() {
    // ToastUtils.show("请求已发送");
    // new HeartLoveRquestUpdateSelfDataAction().call(this, this._pageButtonValues);
  }

  _dealEditCallbackCommon() {
    super._dealEditCallbackCommon();
    this._pageButtonValues.beenUpdated = true;
  }
}
